home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 101-125 / scopedisk114 / fastmenu / prtsetup.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-19  |  3KB  |  84 lines

  1. /* Set various printer parameters through AmigaDos escape codes      */
  2. /* Run ONLY under FastMenu1 as program expects certain libraries     */
  3. /* are open.  These libraries are opened by FastMenu.                */
  4.  
  5. if ~show('P','FASTHOST') then do
  6.     say 'FastMenu1 is not present ... Aborting'
  7.      exit 10
  8. end
  9.  
  10. if show('P','PSETHOST') then do
  11.     say 'PSETHOST Port in Use or PrtSetup Program Running ... Aborting'
  12.     exit 10
  13. end
  14.  
  15. call MenuWindow(PSETHOST,PSETPORT)
  16.  
  17.    call AddGadget(PSETHOST,6,11,"CONON","Condensed On ",     /* + */,
  18.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''1b5b3477''x);call close(PRINTER)'")
  19.    call AddGadget(PSETHOST,124,11,"CONOFF","Condensed Off",     /* + */,
  20.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''1b5b3377''x);call close(PRINTER)'")
  21.    call AddGadget(PSETHOST,6,22,"ELON",  "  Elite  On  ",     /* + */,
  22.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''1b5b3277''x);call close(PRINTER)'")
  23.    call AddGadget(PSETHOST,124,22,"ELOFF", "  Elite  Off ",     /* + */,
  24.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''1b5b3177''x);call close(PRINTER)'")
  25.    call AddGadget(PSETHOST,6,33,"LQON",  "   NLQ On    ",     /* + */,
  26.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''1b5b32227a''x);call close(PRINTER)'")
  27.    call AddGadget(PSETHOST,124,33,"LQOFF",  "   NLQ Off   ",     /* + */,
  28.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''1b5b31227a''x);call close(PRINTER)'")
  29.    call AddGadget(PSETHOST,6,44,"6LPI",  "    6 LPI    ",     /* + */,
  30.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''1b5b317a''x);call close(PRINTER)'")
  31.    call AddGadget(PSETHOST,124,44,"8LPI",  "    8 LPI    ",     /* + */,
  32.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''1b5b307a''x);call close(PRINTER)'")
  33.    call AddGadget(PSETHOST,6,55,"PERF0",   "Skip Perf 0  ",     /* + */,
  34.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''1b5b3071''x);call close(PRINTER)'")
  35.    call AddGadget(PSETHOST,124,55,"PERF8",   "Skip Perf 8  ",     /* + */,
  36.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''1b5b3871''x);call close(PRINTER)'")
  37.    call AddGadget(PSETHOST,6,66,"LFEED", "  Line Feed  ",     /* + */,
  38.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''1b44''x);call close(PRINTER)'")
  39.    call AddGadget(PSETHOST,124,66,"FFEED", "  Form Feed  ",     /* + */,
  40.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''0c''x);call close(PRINTER)'")
  41.    call AddGadget(PSETHOST,6,77,"INIT",    " Initialize  ",     /* + */,
  42.    "'call open(PRINTER,''PRT:'');call writeln(PRINTER,''1b2331 1b63''x);call close(PRINTER)'")
  43.    call AddGadget(PSETHOST,124,77,"QUIT",  "    Quit     ",     /* + */,
  44.    "'address PSETHOST quit'") 
  45.  
  46.    call SetNotify(PSETHOST,GADGETUP,REXX)
  47.    call SetNotify(PSETHOST,CLOSEWINDOW,PSETHOST)
  48.  
  49. exit 0
  50.  
  51. /* MenuWindow.rexx - menu making function */
  52.  
  53. MenuWindow:
  54. arg menuhost, menuport
  55.  
  56. address AREXX  "'x=createhost(" menuhost "," menuport ")'"
  57.  
  58. mp = openport(menuport)
  59. do for 10/(10/50) while ~showlist('p',menuhost)
  60.    call delay 10
  61. end
  62.  
  63. if ~(mp & showlist('p',menuhost)) then
  64.    return
  65.  
  66. idcmp = 'CLOSEWINDOW+GADGETUP'
  67. flags = 'WINDOWDRAG+BACKFILL+WINDOWCLOSE'
  68.  
  69. width = 240
  70. height = 7*11+14
  71.  
  72. xpos =0
  73. ypos = screenrows()-height
  74.  
  75. txt_wid = trunc((width-26)/8) + 1
  76. win_text = center('Printer Setup',txt_wid)
  77.  
  78. call SetReqColor(menuhost,BLOCK,3)
  79.  
  80. /* Open the menu window in the upper left-hand corner */
  81. call OpenWindow(menuhost,xpos,ypos,width,height,idcmp, flags,win_text)
  82.  
  83. return 0
  84.